﻿

Public Class Mapa
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            FG.culturaPaginas()

            'Cargo páginas anterior y actual!!!
            Var_Globales.Setea_paginas("Mapa.aspx")
        End If
    End Sub


    Private Sub colorearPcia(ByRef pcia As String, ByVal cantidad As Integer, ByVal porc As Integer)

        Dim color As String
        color = ""
        pcia = Replace(pcia, " ", "")
        If UCase(pcia) = "CIUDADAUTONOMABUENOSAIRES" Then
            Exit Sub
        End If
        If (porc > 10) Then
            color = "Green"
        Else
            color = "Blue"
        End If

        Master.FindControl("ContenedorMinisterio").FindControl("img" & pcia & color).Visible = True
        Master.FindControl("ContenedorMinisterio").FindControl("img" & pcia & color)
    End Sub

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
        'Me.imgBuenosAiresBlue.Visible = True
        'Me.imgBuenosAiresBlue.ToolTip = "98.7 %"
        'Me.imgCorrientesBlue.Visible = True
        'Me.imgCorrientesBlue.ToolTip = "87.3 %"
        'Me.imgEntreRiosBlue.Visible = True
        'Me.imgEntreRiosBlue.ToolTip = "81.9 %"
        'Me.imgLaPampaBlue.Visible = True
        'Me.imgLaPampaBlue.ToolTip = "79.4 %"
        'Me.imgSantaFeBlue.Visible = True
        'Me.imgSantaFeBlue.ToolTip = "84.2 %"
        'Me.imgMisionesYellow.Visible = True
        'Me.imgMisionesYellow.ToolTip = "36.4 %"
        'Me.imgJujuyRed.Visible = True
        'Me.imgJujuyRed.ToolTip = "18.5 %"
        'Me.imgSaltaRed.Visible = True
        'Me.imgSaltaRed.ToolTip = "15.2 %"
        'Me.imgTucumanRed.Visible = True
        'Me.imgTucumanRed.ToolTip = "10.5 %"
        'Me.imgSantiagoDelEsteroYellow.Visible = True
        'Me.imgSantiagoDelEsteroYellow.ToolTip = "45.4 %"
        ''OJO QUE ME FALTÓ AGREGAR LA PCIA EN ROJO!!!!
        'Me.imgFormosaYellow.Visible = True
        'Me.imgFormosaYellow.ToolTip = "24.7 %"
        'Me.imgChacoYellow.Visible = True
        'Me.imgChacoYellow.ToolTip = "23.2 %"
        'Me.imgSanLuisYellow.Visible = True
        'Me.imgSanLuisYellow.ToolTip = "25.1 %"
        'Me.imgCordobaBlue.Visible = True
        'Me.imgCordobaBlue.ToolTip = "95.9 %"
        'Me.imgChubutYellow.Visible = True
        'Me.imgChubutYellow.ToolTip = "84.3 %"
        'Me.imgSantaCruzYellow.Visible = True
        'Me.imgSantaCruzYellow.ToolTip = "82.3 %"
        'Me.imgTierraDelFuegoYellow.Visible = True
        'Me.imgTierraDelFuegoYellow.ToolTip = "77.6 %"
        'Me.imgRioNegroYellow.Visible = True
        'Me.imgRioNegroYellow.ToolTip = "76.7 %"
        'Me.imgNeuquenBlue.Visible = True
        'Me.imgNeuquenBlue.ToolTip = "87.3 %"
        'Me.imgMendozaBlue.Visible = True
        'Me.imgMendozaBlue.ToolTip = "92.3 %"
        'Me.imgSanJuanYellow.Visible = True
        'Me.imgSanJuanYellow.ToolTip = "80.2 %"
        'Me.imgCatamarcaYellow.Visible = True
        'Me.imgCatamarcaYellow.ToolTip = "78.9 %"
        'Me.imgLaRiojaYellow.Visible = True
        'Me.imgLaRiojaYellow.ToolTip = "75.9 %"




        '===========================================
        '===========================================

        Dim i As Integer

        Dim param(2) As ADODB.Parameter
        Dim Rs As ADODB.Recordset

        param(0) = New ADODB.Parameter
        param(0).Name = "@vacuna"
        param(0).Type = ADODB.DataTypeEnum.adVarChar
        param(0).Direction = ADODB.ParameterDirectionEnum.adParamInput
        param(0).Value = "todas" 'HARDCODE!!!
        param(0).Size = 20

        param(1) = New ADODB.Parameter
        param(1).Name = "@RangoDesde"
        param(1).Type = ADODB.DataTypeEnum.adDate '<--campo fecha
        param(1).Direction = ADODB.ParameterDirectionEnum.adParamInput
        param(1).Value = "1/10/2013" 'HARDCODE!!!

        param(2) = New ADODB.Parameter
        param(2).Name = "@RangoDesde"
        param(2).Type = ADODB.DataTypeEnum.adDate '<--campo fecha
        param(2).Direction = ADODB.ParameterDirectionEnum.adParamInput
        param(2).Value = "10/11/2013" 'HARDCODE!!!


        Rs = Datos.TraerTodos("Trae_PorcentajeDeVacunadosXVacunaYfecha", param, "Informe1.aspx")


        Rs.MoveFirst()


        For i = 1 To Rs.RecordCount

            colorearPcia(Rs.Fields(0).Value.ToString, CInt(Rs.Fields(1).Value), CInt(Rs.Fields(2).Value))

            Rs.MoveNext()

        Next i




    End Sub
End Class